package com.ilifang.pem.ws;

import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;

/**
 * Created by Administrator on 2016/3/15.
 */
public class GasDataSender implements Runnable {

    public static String data = "{stationId:12,nodeId:13,nodeState:0,oxygen:20,co:200,ch4:100,humidity:60,temperature:20,\n" +
            "        pa:500,sensor_electric:20,power_save_electric:20,timestamp:\"2016-03-15 23:23:00\"}";

    @Override
    public void run() {
        while (true) {
            try {
                Thread.sleep(1000);
                Global.group.writeAndFlush(new TextWebSocketFrame(data));
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
    }
}
